{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ATM_POS</th>\n",
       "      <th>TBM</th>\n",
       "      <th>CSC</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>-0.852354</td>\n",
       "      <td>-0.294938</td>\n",
       "      <td>0.143935</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>-0.333078</td>\n",
       "      <td>-0.244334</td>\n",
       "      <td>0.939343</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0.918067</td>\n",
       "      <td>0.593787</td>\n",
       "      <td>2.349496</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>-0.741847</td>\n",
       "      <td>-0.210507</td>\n",
       "      <td>-0.521592</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>-0.499703</td>\n",
       "      <td>-0.492714</td>\n",
       "      <td>-0.367629</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    ATM_POS       TBM       CSC\n",
       "0 -0.852354 -0.294938  0.143935\n",
       "1 -0.333078 -0.244334  0.939343\n",
       "2  0.918067  0.593787  2.349496\n",
       "3 -0.741847 -0.210507 -0.521592\n",
       "4 -0.499703 -0.492714 -0.367629"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# df 为清洗好的数据\n",
    "df = pd.read_csv('data_clean.csv')\n",
    "df.head()\n",
    "## csc: counter service for customer -- 选择柜台服务的客户\n",
    "## ATM_POS: 使用 ATM 和 POS 服务的客户\n",
    "## TBM：有偿服务"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## K-Means 聚类的第一种方式\n",
    "###### 不进行变量分布的正太转换--用于寻找异常值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "TBM        51.881233\n",
       "CSC         6.093417\n",
       "ATM_POS     2.097633\n",
       "dtype: float64"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 使用k-means聚类\n",
    "## 1.1 k-means聚类的第一种方式：不进行变量分布的正态转换--用于寻找异常值\n",
    "\n",
    "# 1、查看变量的偏度\n",
    "var = [\"ATM_POS\",\"TBM\",\"CSC\"]  # var: variable-变量\n",
    "skew_var = {}\n",
    "for i in var:\n",
    "    skew_var[i]=abs(df[i].skew()) # .skew() 求该变量的偏度\n",
    "    skew=pd.Series(skew_var).sort_values(ascending=False)\n",
    "skew"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "KMeans(algorithm='auto', copy_x=True, init='k-means++', max_iter=300,\n",
       "    n_clusters=3, n_init=10, n_jobs=None, precompute_distances='auto',\n",
       "    random_state=None, tol=0.0001, verbose=0)"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 进行k-means聚类\n",
    "from sklearn.cluster import KMeans\n",
    "kmeans = KMeans(n_clusters=3) # n_clusters=3 表示聚成3类\n",
    "# kmeans = cluster.KMeans(n_clusters=3, init='random', n_init=1)\n",
    "result = kmeans.fit(df)\n",
    "result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ATM_POS</th>\n",
       "      <th>TBM</th>\n",
       "      <th>CSC</th>\n",
       "      <th>clustor</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>75557</th>\n",
       "      <td>-0.660390</td>\n",
       "      <td>-0.491282</td>\n",
       "      <td>-0.473513</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>87072</th>\n",
       "      <td>3.435500</td>\n",
       "      <td>0.606897</td>\n",
       "      <td>0.272691</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>66524</th>\n",
       "      <td>-0.890393</td>\n",
       "      <td>1.158563</td>\n",
       "      <td>1.957567</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>348</th>\n",
       "      <td>-0.885561</td>\n",
       "      <td>-0.411805</td>\n",
       "      <td>-0.506717</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>62663</th>\n",
       "      <td>-0.592656</td>\n",
       "      <td>0.413549</td>\n",
       "      <td>-0.374998</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>51898</th>\n",
       "      <td>2.343226</td>\n",
       "      <td>1.188243</td>\n",
       "      <td>0.198308</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>65429</th>\n",
       "      <td>-0.885617</td>\n",
       "      <td>0.309940</td>\n",
       "      <td>0.152809</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>53632</th>\n",
       "      <td>0.059517</td>\n",
       "      <td>-0.171865</td>\n",
       "      <td>-0.476880</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>87599</th>\n",
       "      <td>-0.562473</td>\n",
       "      <td>-0.025141</td>\n",
       "      <td>-0.540707</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>59717</th>\n",
       "      <td>-0.380191</td>\n",
       "      <td>0.043765</td>\n",
       "      <td>-0.320864</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        ATM_POS       TBM       CSC  clustor\n",
       "75557 -0.660390 -0.491282 -0.473513        1\n",
       "87072  3.435500  0.606897  0.272691        0\n",
       "66524 -0.890393  1.158563  1.957567        2\n",
       "348   -0.885561 -0.411805 -0.506717        1\n",
       "62663 -0.592656  0.413549 -0.374998        1\n",
       "51898  2.343226  1.188243  0.198308        0\n",
       "65429 -0.885617  0.309940  0.152809        1\n",
       "53632  0.059517 -0.171865 -0.476880        1\n",
       "87599 -0.562473 -0.025141 -0.540707        1\n",
       "59717 -0.380191  0.043765 -0.320864        1"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 对分类结果进行解读\n",
    "model_data_l = df.join(pd.DataFrame(result.labels_)) \n",
    "                            # .labels_ 表示这一个数据点属于什么类\n",
    "model_data_l = model_data_l.rename(columns={0: \"clustor\"})\n",
    "model_data_l.sample(10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0x1e2d5b3e748>"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAPUAAADnCAYAAADGrxD1AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAAXU0lEQVR4nO3de5gcVZ3G8e/puWa6Z3hALgkQKRAIBMIaHgggIrvwCEi5ugiCyz6ICHKRdUHEpeTiNizs1rqPCLtednFFuQjhKgYrIkq8ACKEeyAQbikMBBKSzPRkLpnr2T+qkDFOZnqmu+tUnf59nqcfk2FmzovMO1V9quocpbVGCGGPnOkAQojqklILYRkptRCWkVILYRkptRCWkVILYRkptRCWkVILYRkptRCWkVILYRkptRCWkVILYRkptRCWkVILYRkptRCWkVILYRkptRCWkVILYRkptRCWkVILYRkptRCWkVILYRkptRCWkVILYRkptRCWkVILYRkptRCWaTQdQFSf4wUK2AnYPX7NAraOX9uM+XMh/pLRzV4jQA+wAegE1gJrgLeBVcCLoe++mdC/jpgiJRvkZZvjBbsCBwLzgTnAHsBuQFuNh94IvDjmtRz4Q+i7b9d4XDEJKXWGOF7QCCwAPhy/DgG2NRrqL70KPBS/Hgx9d4XhPHVHSp1yjhdsAxwLfBw4BtjKbKIpewe4H/gJcF/ou72G81hPSp1CjhfsBpwA/C3R0bjBbKKq2QT8kqjg94a+u85wHitJqVPC8YI2oiKfBhwOKLOJam4EeAC4Hrgn9N0Bw3msIaU2zPGCg4HPAycBHYbjmLIBuBH4Xui7L5kOk3VSagMcL8gRHZUvAvY3HCdNNLAE+Fbou4HpMFklpU6Q4wXNwKnAV4kuPYktexK4kujUXH5Ip0BKnQDHC/LAOc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+V6vVPZVSx8ZjNADXa62vqsU4SZNSGxCX+8z4NctwnHG91nJyZ06xtYGhXyXaB/oGiqVNBsbPPCm1QY4XNALHEa2PdrjhOH/m5ZZT3mhSIzsnNNwwcB9wPbAoK/tAp5WUOiUcL9gHOBv4NLCD4Ti80PK5l2eowT1qPMxyojXhbqZYervGY9UNKXXKOF6QAw4jKvfxwEwTOZ5pOWPZVqpvXg2+9R+Be4lOr5fW4PvXPSl1isUFPxQ4ATgamJPU2I+2fPHxHVTXAVX4VsPA74HFQECx9FwVvqeYgJQ6Qxwv2JnoEszhwIeJroPXxK+bL3hk19zbh0zjS4eI7sV+DPgNcD/FUlc1s4mJSakzLL7+vT8wD9g3fu1NFS6X3dt88YPzcuFhk3zaANFs9RNEJV4KPE2xZPNqpKknpbaM4wUNREfwOcCORO/JZ415zQQKQBPQzPj3/w/e0OQvObzh2TlAZ/x6E3gNWDnmf1dnectXW0mp65zjBYr3Cq6A/tB3rV3VpR5IqYWwjDzQIYRlpNRCWEZKLYRlpNRCWEZKLYRlpNRCWEZKLYRlpNRCWEZKLYRlpNRCWEZKLYRlpNRCWEZKLYRlpNRCWEZKLYRlpNRCWEZKLYRlpNRCWEZKLYRlpNRCWEZKLYRlpNRCWEZKLYRlpNRCWEZKLYRlpNRCWEZKLYRl/h++AJZDntv56gAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 饼图呈现\n",
    "import matplotlib\n",
    "get_ipython().magic('matplotlib inline')\n",
    "model_data_l.clustor.value_counts().plot(kind = 'pie') \n",
    "# 自然就能发现出现分类很不平均的现象"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "结合前面的求每个变量的偏度：\n",
    "\n",
    "    TBM        51.881233\n",
    "    CSC         6.093417\n",
    "    ATM_POS     2.097633\n",
    "\n",
    "其中 TBM 这个变量的偏度异常，果然影响了分类情况（饼图可清晰看出很不平均）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##  k-means聚类的第二种方式\n",
    "###### 进行变量分布的正态转换--用于客户细分"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ATM_POS</th>\n",
       "      <th>TBM</th>\n",
       "      <th>CSC</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>-0.501859</td>\n",
       "      <td>-0.265036</td>\n",
       "      <td>0.770485</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.097673</td>\n",
       "      <td>-0.154031</td>\n",
       "      <td>1.316637</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0.952085</td>\n",
       "      <td>1.168354</td>\n",
       "      <td>1.845934</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>-0.333179</td>\n",
       "      <td>-0.084688</td>\n",
       "      <td>-1.780166</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>-0.071278</td>\n",
       "      <td>-0.888898</td>\n",
       "      <td>-0.066404</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    ATM_POS       TBM       CSC\n",
       "0 -0.501859 -0.265036  0.770485\n",
       "1  0.097673 -0.154031  1.316637\n",
       "2  0.952085  1.168354  1.845934\n",
       "3 -0.333179 -0.084688 -1.780166\n",
       "4 -0.071278 -0.888898 -0.066404"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 进行变量分布的正态转换\n",
    "import numpy as np\n",
    "from sklearn import preprocessing\n",
    "quantile_transformer = \\\n",
    "    preprocessing.QuantileTransformer(output_distribution='normal', \n",
    "                                      random_state=0) # 正态转换\n",
    "## 插播：转换的方式有很多种，每种都会涉及一些咋看起来比较晦涩的统计学公式\n",
    "## 但请不要担心，每种代码其实都是比较固定的，\n",
    "  ## 这里使用 QT 转换（每种转换的原理和特点优劣等可参考网络资源）\n",
    "\n",
    "df_trans = quantile_transformer.fit_transform(df)\n",
    "df_trans = pd.DataFrame(df_trans)  \n",
    " # 因为 .fit_transform 转换出来的数据类型为 Series，\n",
    "    ## 所以用 pandas 给 DataFrame 化一下\n",
    "\n",
    "df_trans = df_trans.rename(columns={0: \"ATM_POS\", 1: \"TBM\", 2: \"CSC\"})\n",
    "df_trans.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "CSC        0.000521\n",
       "ATM_POS    0.000452\n",
       "TBM        0.000091\n",
       "dtype: float64"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 检验一下偏度：发现几乎都为 0 了\n",
    "var = [\"ATM_POS\",\"TBM\",\"CSC\"]\n",
    "skew_var = {}\n",
    "# 循环计算偏度：发现都差不多等于 0 了。\n",
    "for i in var:\n",
    "    skew_var[i] = abs(df_trans[i].skew())\n",
    "    skew = pd.Series(skew_var).sort_values(ascending=False)\n",
    "skew  # 字典显示更方便"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ATM_POS</th>\n",
       "      <th>TBM</th>\n",
       "      <th>CSC</th>\n",
       "      <th>clustor</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>-0.501859</td>\n",
       "      <td>-0.265036</td>\n",
       "      <td>0.770485</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.097673</td>\n",
       "      <td>-0.154031</td>\n",
       "      <td>1.316637</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0.952085</td>\n",
       "      <td>1.168354</td>\n",
       "      <td>1.845934</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>-0.333179</td>\n",
       "      <td>-0.084688</td>\n",
       "      <td>-1.780166</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>-0.071278</td>\n",
       "      <td>-0.888898</td>\n",
       "      <td>-0.066404</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    ATM_POS       TBM       CSC  clustor\n",
       "0 -0.501859 -0.265036  0.770485        1\n",
       "1  0.097673 -0.154031  1.316637        3\n",
       "2  0.952085  1.168354  1.845934        3\n",
       "3 -0.333179 -0.084688 -1.780166        2\n",
       "4 -0.071278 -0.888898 -0.066404        1"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 重复的聚类步骤，代码可直接粘贴\n",
    "kmeans = KMeans(n_clusters=4)  # 这次聚成 4 类\n",
    "result = kmeans.fit(df_trans)\n",
    "\n",
    "model_data_l = df_trans.join(pd.DataFrame(result.labels_))\n",
    "model_data_l = model_data_l.rename(columns={0: \"clustor\"})\n",
    "model_data_l.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0x1e2d4d91ac8>"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAPUAAADnCAYAAADGrxD1AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAAgAElEQVR4nO2deXxcZb3/3885c2bJTCZbkzZdp2vaAoWyWQQRgStIJSoXERBXXJCrgv68mnvd8OrFeu91A69cUUQQFJBFkACKWJayLylQaAtd0iVtlmabfT3P748z3UhL0mZmzszJ83698koymXOezyT5zLN9n+9XSClRKBTOQbNbgEKhKCzK1AqFw1CmVigchjK1QuEwlKkVCoehTK1QOAxlaoXCYShTKxQOQ5laoXAYytQKhcNQplYoHIYytULhMJSpFQqHoUytUDgMZWqFwmEoUysUDkOZWqFwGMrUCoXDUKZWKByGMrVC4TCUqRUKh6FMrVA4DGVqhcJhKFMrFA5DmVqhcBjK1AqFw1CmVigchstuAYrCE2prdwEzgdnAHCAE1AJ+oOptPueAwYN8DOU/dwNrOlcs7yrZC1IcEkIVyKtwrqpZBBwDLAaOAI5Y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ufT8S3vZRIpLD2+B/D2mXYrubM40eZ2kbyASzzgZOBZYALiGIluJPCEHpgcWCWd6Z3trvRPUev1pvtjFa74J7UlvPX6YcUVWZKKXflcls3pFLrn4rHtm5KpzWsUcpOrGQUHaOl51UcGsrUZUJwadCHFXZ6GrA4/3AcGCLfg+vVute/0B/yTvfOdk9yz9H9+qRSajz18fT2Lz6pve3wOydldiiX6+7JZru2pNNdT8Vjff253O5jm33Ak1jrFZ2qVy4OytRlSH54vhhYChwJGFi9WwQrYYMJYDQYAe8sb7N7krvRVeNqdFW7GvUqvVG4RFHOPi9Yl931g3vY80ZiSikjprmrL5vt2p7JdL2ZSnWtSSbDGWQA2L1ltxF4Cngd6FVGLj7K1GVOfog+HZiHdUKsBcvgGtYiWwyrR9+z5eOe7K7xTPU0Gg3GJL1Kr9bcmk9zaz7hFj7N0HzCJayPfQJhpJQgySExpSlz+a9zZsZMiKGsyz1kJmqGzDcvfDAb68lmBrsymcEt6Uwib+AqrGAbAezCysr6KrB+ZSRy0Eg8RXFQpq4wgkuDbqykiNOB2ViZT5uxTC4BHcvsSaxheyb/ecQ+r+bRXAiEzMqczMoD7QMLwB2MySUzdlHjzbA+/5iZ/xwD1mOZeBvQtTISqdi6zk5BmdoB5HvzOqARmIxl9CYgCATyHzqWGcfyBxfsNe+wOyMToR4y1Umex+qJB/Ofh9RwuvxQpp4A5KPbDMCHNVT2Ya205w7wYeY/p4B4vuaYooJQplYoHEZFHwdUKBQjUaZWKByGMrVC4TCUqRUKh6FMrVA4DGVqhcJhKFMrFA5DmVqhcBjK1AqFw1CmVigchjK1QuEwlKkVCoehTK1QOAxlaoXCYShTKxQOQ5laoXAYytQKhcNQplYoHIYytULhMJSpFQqHoUytUDgMZWqFwmEoUysUDkOZWqFwGMrUCoXD+P9GgdfnfeSaewAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "model_data_l.clustor.value_counts().plot(kind='pie',\n",
    "                   shadow=True, autopct='%.2f%%') # 两位小数百分比"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  },
  "latex_envs": {
   "LaTeX_envs_menu_present": true,
   "autoclose": false,
   "autocomplete": true,
   "bibliofile": "biblio.bib",
   "cite_by": "apalike",
   "current_citInitial": 1,
   "eqLabelWithNumbers": true,
   "eqNumInitial": 1,
   "hotkeys": {
    "equation": "Ctrl-E",
    "itemize": "Ctrl-I"
   },
   "labels_anchors": false,
   "latex_user_defs": false,
   "report_style_numbering": false,
   "user_envs_cfg": false
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  },
  "varInspector": {
   "cols": {
    "lenName": 16,
    "lenType": 16,
    "lenVar": 40
   },
   "kernels_config": {
    "python": {
     "delete_cmd_postfix": "",
     "delete_cmd_prefix": "del ",
     "library": "var_list.py",
     "varRefreshCmd": "print(var_dic_list())"
    },
    "r": {
     "delete_cmd_postfix": ") ",
     "delete_cmd_prefix": "rm(",
     "library": "var_list.r",
     "varRefreshCmd": "cat(var_dic_list()) "
    }
   },
   "types_to_exclude": [
    "module",
    "function",
    "builtin_function_or_method",
    "instance",
    "_Feature"
   ],
   "window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
